# with语句，执行完毕后自动关闭已打开的文件，无需手动操作
def write_fun():
    with open('e.txt', 'w', encoding='utf-8') as file:
        file.write('2028年世界杯')


def read_fun():
    with open('e.txt', 'r', encoding='utf-8') as file:
        print(file.read())


def copy(src_file, target_file):
    with open(src_file, 'r', encoding='utf-8') as file1:
        with open(target_file, 'w', encoding='utf-8') as file2:
            file2.write(file1.read())


if __name__ == '__main__':
    write_fun()
    read_fun()
    copy('./e.txt', './f.txt')
